<!DOCTYPE html>
<html lang="en">
<head>
       // 编码格式 为 utf-8
	<meta charset="UTF-8">
	<title>我的留言</title>
	<link href="css/xianshi.css" rel='stylesheet' type='text/css' />
	<link href="css/style.css" rel='stylesheet' type='text/css' />
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="keywords" content="Pink Contact Form ,Login Forms,Sign up Forms,Registration Forms,News latter Forms,Elements"./>
<script type="application/x-javascript"> addEventListener("load", function() { setTimeout(hideURLbar, 0); }, false); function hideURLbar(){ window.scrollTo(0,1); } </script>

</head>
<body>
	<h1>我的留言</h1>

	<div class="login-01">
	<div class="copy-right">
   		<a href="index.php"><input type="submit" onClick="myFunction()" value="添加留言" ></a>
   			<div class="wrap"></div>
	</div>
			<div class="clear"></div>
</div>
	<div class="login-01 " style="background-color: #fc3;">
	<div class="copy-right">
   			<div class="wrap"></div>
	</div>
			<ul>
			 <?php
			 include_once "config.php";//这页包含config.php这个文件
        $sql = "SELECT * FROM  message";  
        $result = $conn->query($sql);  // 这个是执行上面的sql语句，然后将结果赋给 $result 
        $arrlist = array();
        if ($result->num_rows > 0) {  
        // 输出每行数据
        while($row = $result->fetch_assoc()) {
                array_push($arrlist, $row);        
            }
        } 
          ?>
          <?php
        foreach ($arrlist as $vo){
        ?>
				<li class="first">
				<p style="padding: 5px; margin: 10px;">名字：<?php echo $vo['username'] ?><br />时间：<?php echo $vo['time_at'] ?></p>
				<p style="padding-left: 40px;  margin-top: 10px; " ><?php echo $vo['content'] ?></p>
					<div class="clear"></div>
				</li>		
                <?php    }   ?>

			</ul>
			<div class="clear"></div>
</div>

</body>
</html>